package com.example.lotterysystem.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.lotterysystem.dao.dataobject.Activity;
import com.example.lotterysystem.dao.dataobject.Prize;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface ActivityMapper extends BaseMapper<Activity> {
    @Select("select * from activity order by id desc limit #{pageSize} offset #{offset}")
    List<Activity> selectActivityList(@Param("offset") Integer offset,
                                @Param("pageSize") Integer pageSize);

    @Update("update activity set status = #{status} where id = #{id}")
    Integer updateStatus(@Param("id") Long activityId, @Param("status") String status);
}
